/* RabbitMQ Demo 测试页面样式 */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 自定义卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-header h4, .card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
}

/* 导航样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* 侧边栏样式 */
.list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    transition: var(--transition);
    cursor: pointer;
}

.list-group-item:hover {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
    border-color: var(--primary-color);
    color: white;
}

.list-group-item i {
    width: 20px;
    margin-right: 8px;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    border: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e6a700 100%);
    color: #212529;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b02a37 100%);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #3dd5f3 100%);
    color: #212529;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5c636a 100%);
}

.btn-dark {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1e21 100%);
}

/* 按钮组样式 */
.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* 响应区域样式 */
#response-area {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

#response-area.alert-success {
    background: linear-gradient(135deg, #d1edff 0%, #e8f5e8 100%);
    border-left: 4px solid var(--success-color);
}

#response-area.alert-danger {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffeaea 100%);
    border-left: 4px solid var(--danger-color);
}

#response-area.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #fef5e7 100%);
    border-left: 4px solid var(--warning-color);
}

#response-area.alert-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #e3f2fd 100%);
    border-left: 4px solid var(--info-color);
}

/* 代码样式 */
pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

code {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 0.125rem 0.25rem;
    font-size: 0.875rem;
}

/* 连接状态样式 */
.status-connected {
    color: var(--success-color);
}

.status-disconnected {
    color: var(--danger-color);
}

.status-unknown {
    color: #6c757d;
}

/* 消息项样式 */
.message-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #dee2e6;
    transition: var(--transition);
}

.message-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease-in-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .form-control, .form-select {
        font-size: 0.875rem;
    }
    
    /* 移动端的列布局调整 */
    .col-md-3, .col-md-6, .col-md-4, .col-md-8, .col-md-9 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 0.25rem;
        width: 100%;
    }
    
    .row .col-md-4, .row .col-md-6, .row .col-md-8 {
        margin-bottom: 1rem;
    }
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.75rem;
}

/* 表格样式 */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background: linear-gradient(135deg, var(--light-color) 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* 图标样式 */
.bi {
    vertical-align: -0.125em;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 焦点状态 */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 禁用状态 */
.disabled, :disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 成功/错误状态指示 */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-indicator.success {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.5);
}

.status-indicator.error {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.status-indicator.warning {
    background-color: var(--warning-color);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

/* 数据展示区域 */
.data-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* 快捷操作按钮 */
.quick-actions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.quick-actions .btn {
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #212529;
        color: #ffffff;
    }
    
    .card {
        background-color: #343a40;
        border-color: #495057;
    }
    
    .card-header {
        background: linear-gradient(135deg, #343a40 0%, #495057 100%);
        border-color: #495057;
    }
    
    .form-control, .form-select {
        background-color: #495057;
        border-color: #6c757d;
        color: #ffffff;
    }
    
    .form-control:focus, .form-select:focus {
        background-color: #495057;
        border-color: var(--primary-color);
    }
    
    .list-group-item {
        background-color: #343a40;
        border-color: #495057;
        color: #ffffff;
    }
}
